/**
 * @param {string} s1
 * @param {string} s2
 * @return {boolean}
 */
var checkInclusion = function (s1, s2) {
    let len1 = s1.length
    let len2 = s2.length
    if (len1 > len2) {
        return false
    }
    let cnt1 = new Array(26).fill(0)
    let cnt2 = new Array(26).fill(0)
    // 将s1长度的字符放入数组作为标记
    for (let i = 0; i < len1; i++) {
        cnt1[s1[i].charCodeAt() - 'a'.charCodeAt()]++
        cnt2[s2[i].charCodeAt() - 'a'.charCodeAt()]++
    }
    if (cnt1.toString() === cnt2.toString()) {
        return true
    }
    // 移动窗口
    for (let i = len1; i < len2; i++) {
        cnt2[s2[i].charCodeAt() - 'a'.charCodeAt()]++
        cnt2[s2[i - n].charCodeAt() - 'a'.charCodeAt()]--
        if (cnt1.toString() === cnt2.toString()) {
            return true
        }
    }
    return false
};